Skip to content

TDS_3: Add an edge iterator that puts marks in Cell_data #4346

Draft
afabri wants to merge 4 commits intoCGAL:mainfrom
afabri:TDS_3-Edge_iterator-GF
Draft

TDS_3: Add an edge iterator that puts marks in Cell_data #4346
afabri wants to merge 4 commits intoCGAL:mainfrom
afabri:TDS_3-Edge_iterator-GF

Conversation

@afabri
Copy link
Member

@afabri afabri commented Nov 6, 2019

Summary of Changes

The edge iterator uses a cell iterator and for each edge of the cell gravitates around the edge. In case it finds a cell with a smaller address it it not the "representative" of the edge.

This PR proposes as alternative an edge iterator that stores in TDS_3::Cell_data if an edge was already seen before. If not seen one gravitates around to find the cell with smallest address, and marks the edge in all incident cells.

This is faster (In vtune I saw that on one data set make_mesh_3() passed 7% in the operator++() of the edge iterator while protecting edges) and the bits of Cell_data were not used so far.
However, after a loop over edges one must loop over all cells to reset the mark. Also one cannot loop over all edges in two threads.

I added new names for the iterators which are up to discussion, but before that it would be good to see if there is a degradation of performance of large 3D triangulations, as setting the old marks are now bit setting operations and not just an assignment of 0, 1, or 2.

Release Management

  • Affected package(s): TDS_3

@MaelRL MaelRL changed the base branch from master to releases/CGAL-4.14-branch March 26, 2020 20:05
@MaelRL MaelRL changed the base branch from releases/CGAL-4.14-branch to master March 26, 2020 20:05
@MaelRL MaelRL added this to the 5.2-beta milestone Sep 22, 2020
@MaelRL MaelRL modified the milestones: 5.2-beta, 5.3-beta Oct 14, 2020
@sloriot sloriot modified the milestones: 5.3-beta, 5.4-beta Mar 22, 2021
@sloriot sloriot modified the milestones: 5.4-beta, 5.5-beta1 Sep 23, 2021
@sloriot
Copy link
Member

sloriot commented Jan 3, 2022

@afabri If you have an id per cell, then the iterator can store a bitset encoding the visited status. This solves the multi-thread issues and removes the need of resetting since the bitset is simply dropped.

@MaelRL MaelRL modified the milestones: 5.5-beta, 5.6-beta Mar 28, 2022
@MaelRL MaelRL modified the milestones: 5.6-beta, 5.7-beta Mar 23, 2023
@janetournois janetournois modified the milestones: 6.0-beta, 6.1-beta May 16, 2024
@MaelRL MaelRL modified the milestones: 6.1-beta, 6.2-beta Mar 17, 2025
@sloriot sloriot changed the base branch from master to main September 16, 2025 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants